package com.itheima.d10_AnLi.ZengAnliTest;

import java.util.ArrayList;
import java.util.List;
import java.util.Random;

/**
 * @ClassName ZengDemo
 * @Author 16799
 * @Date 2025/9/24 20:27
 * @Version 1.0
 * @Description TODO
 **/
public class ZengDemo {
    public static void main(String[] args) throws Exception {
        List<String> gift = new ArrayList<>();
        String[] selects = {"口红","包包","鲜花","剃须刀","皮带","手表"};

        Random r = new Random();
        for (int i = 0; i < 100; i++) {
            gift.add(selects[r.nextInt(selects.length)] + (i+1));
        }

        System.out.println(gift);

        ZengThreadTest xiaoming = new ZengThreadTest(gift,"小明");
        xiaoming.start();
        ZengThreadTest xiaohong = new ZengThreadTest(gift,"小红");
        xiaohong.start();

        xiaoming.join();
        xiaohong.join();
        System.out.println(xiaoming.getCount());
        System.out.println(xiaohong.getCount());
    }
}
